/ Celestin Apprentice 7
/ Apprentice-Release7.iso / Demos / A.D. Software / OOFILE 1.3b4d6.sit / OOFILE 1.3b4d6 / MacCodeWarriorDemo1.3b4d6 / docs / samples / ooftst07.cpp ![]() | < prev | next > |
MacBinary | 1997-03-18 | 1.6 KB | [TEXT/CWIE] |
Confidence | Program | Detection | Match Type | Support |
---|---|---|---|---|
10% | dexvert | MacBinary (archive/macBinary) | fallback | Supported |
1% | dexvert | Text File (text/txt) | fallback | Supported |
100% | file | MacBinary II, Mon Mar 17 20:06:33 1997, modified Mon Mar 17 20:06:33 1997, creator 'CWIE', type ASCII, 965 bytes "ooftst07.cpp" , at 0x445 410 bytes resource | default (weak) | |
99% | file | data | default | |
74% | TrID | Macintosh plain text (MacBinary) | default | |
25% | TrID | MacBinary 2 | default (weak) | |
100% | siegfried | fmt/1762 MacBinary (II) | default | |
100% | lsar | MacBinary | default |
id metadata | |
---|---|
key | value |
macFileType | [TEXT] |
macFileCreator | [CWIE] |
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 6f 6f 66 74 73 74 | 30 37 2e 63 70 70 00 00 |..ooftst|07.cpp..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 03 c5 00 | 00 01 9a af 53 9b 19 af |........|....S...|
|00000060| 53 9b 19 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |S.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 40 56 00 00 |........|....@V..|
|00000080| 2f 2f 20 43 6f 70 79 72 | 69 67 68 74 20 31 39 39 |// Copyr|ight 199|
|00000090| 34 20 41 2e 44 2e 20 53 | 6f 66 74 77 61 72 65 2e |4 A.D. S|oftware.|
|000000a0| 20 41 6c 6c 20 52 69 67 | 68 74 73 20 52 65 73 65 | All Rig|hts Rese|
|000000b0| 72 76 65 64 0d 0d 2f 2f | 20 4f 4f 46 54 45 53 54 |rved..//| OOFTEST|
|000000c0| 37 0d 0d 2f 2f 20 74 68 | 69 73 20 73 61 6d 70 6c |7..// th|is sampl|
|000000d0| 65 20 64 65 6d 6f 6e 73 | 74 72 61 74 65 73 20 73 |e demons|trates s|
|000000e0| 65 61 72 63 68 69 6e 67 | 20 61 6e 64 20 73 6f 72 |earching| and sor|
|000000f0| 74 69 6e 67 20 62 79 20 | 0d 2f 2f 20 64 69 66 66 |ting by |.// diff|
|00000100| 65 72 65 6e 74 20 74 79 | 70 65 73 20 6f 66 20 66 |erent ty|pes of f|
|00000110| 69 65 6c 64 73 2c 20 61 | 6e 64 20 68 6f 77 20 74 |ields, a|nd how t|
|00000120| 6f 20 70 61 72 61 6d 65 | 74 65 72 69 7a 65 0d 2f |o parame|terize./|
|00000130| 2f 20 63 61 6c 6c 73 2c | 20 70 61 73 73 69 6e 67 |/ calls,| passing|
|00000140| 20 69 6e 20 74 61 62 6c | 65 20 61 6e 64 20 66 69 | in tabl|e and fi|
|00000150| 65 6c 64 20 72 65 66 65 | 72 65 6e 63 65 73 0d 0d |eld refe|rences..|
|00000160| 2f 2f 20 53 69 6d 70 6c | 65 20 73 74 72 65 61 6d |// Simpl|e stream|
|00000170| 20 49 2f 4f 20 69 73 20 | 75 73 65 64 20 74 6f 20 | I/O is |used to |
|00000180| 69 6e 74 65 72 61 63 74 | 20 77 69 74 68 20 74 68 |interact| with th|
|00000190| 65 20 75 73 65 72 2e 0d | 23 69 6e 63 6c 75 64 65 |e user..|#include|
|000001a0| 20 22 6f 6f 66 69 6c 65 | 2e 68 22 0d 0d 23 64 65 | "oofile|.h"..#de|
|000001b0| 66 69 6e 65 20 54 45 53 | 54 5f 49 4e 44 45 58 45 |fine TES|T_INDEXE|
|000001c0| 53 0d 09 0d 23 69 6e 63 | 6c 75 64 65 20 22 6f 6f |S...#inc|lude "oo|
|000001d0| 66 74 73 74 30 37 2e 68 | 22 0d 0d 69 6e 74 20 6d |ftst07.h|"..int m|
|000001e0| 61 69 6e 28 29 0d 7b 0d | 09 63 6f 75 74 20 3c 3c |ain().{.|.cout <<|
|000001f0| 20 22 4f 4f 46 49 4c 45 | 20 56 61 6c 69 64 61 74 | "OOFILE| Validat|
|00000200| 69 6f 6e 20 53 75 69 74 | 65 20 2d 20 54 65 73 74 |ion Suit|e - Test|
|00000210| 20 37 5c 6e 22 0d 09 09 | 20 3c 3c 20 22 53 69 6d | 7\n"...| << "Sim|
|00000220| 70 6c 65 20 74 65 73 74 | 20 74 6f 20 64 65 6d 6f |ple test| to demo|
|00000230| 6e 73 74 72 61 74 65 20 | 63 6f 6d 70 61 72 61 74 |nstrate |comparat|
|00000240| 69 76 65 20 73 65 61 72 | 63 68 65 73 22 20 3c 3c |ive sear|ches" <<|
|00000250| 20 65 6e 64 6c 0d 09 09 | 20 3c 3c 20 22 75 73 69 | endl...| << "usi|
|00000260| 6e 67 20 61 20 64 61 74 | 61 62 61 73 65 20 73 69 |ng a dat|abase si|
|00000270| 6d 69 6c 61 72 20 74 6f | 20 6f 6f 66 74 65 73 74 |milar to| ooftest|
|00000280| 32 20 62 75 74 20 77 69 | 74 68 20 6c 6f 74 73 20 |2 but wi|th lots |
|00000290| 6f 66 20 69 6e 64 65 78 | 65 64 20 66 69 65 6c 64 |of index|ed field|
|000002a0| 73 22 20 3c 3c 20 65 6e | 64 6c 3b 0d 09 0d 09 23 |s" << en|dl;....#|
|000002b0| 69 66 64 65 66 20 54 45 | 53 54 49 4e 47 5f 44 42 |ifdef TE|STING_DB|
|000002c0| 41 53 45 0d 09 09 23 69 | 66 64 65 66 20 5f 4d 61 |ASE...#i|fdef _Ma|
|000002d0| 63 69 6e 74 6f 73 68 0d | 09 09 09 63 6f 6e 73 74 |cintosh.|...const|
|000002e0| 20 63 68 61 72 2a 20 6b | 45 78 69 73 74 73 4e 61 | char* k|ExistsNa|
|000002f0| 6d 65 20 3d 20 20 22 3a | 6f 6f 66 74 73 74 30 37 |me = ":|ooftst07|
|00000300| 3a 50 65 6f 70 6c 65 2e | 64 62 66 22 3b 0d 09 09 |:People.|dbf";...|
|00000310| 09 63 6f 6e 73 74 20 63 | 68 61 72 2a 20 6b 44 61 |.const c|har* kDa|
|00000320| 74 61 62 61 73 65 4e 61 | 6d 65 20 3d 20 22 3a 6f |tabaseNa|me = ":o|
|00000330| 6f 66 74 73 74 30 37 3a | 22 3b 0d 09 09 23 65 6c |oftst07:|";...#el|
|00000340| 73 65 0d 09 09 09 63 6f | 6e 73 74 20 63 68 61 72 |se....co|nst char|
|00000350| 2a 20 6b 45 78 69 73 74 | 73 4e 61 6d 65 20 3d 20 |* kExist|sName = |
|00000360| 20 20 22 50 65 6f 70 6c | 65 2e 64 62 66 22 0d 09 | "Peopl|e.dbf"..|
|00000370| 09 09 63 6f 6e 73 74 20 | 63 68 61 72 2a 20 6b 44 |..const |char* kD|
|00000380| 61 74 61 62 61 73 65 4e | 61 6d 65 20 3d 20 22 22 |atabaseN|ame = ""|
|00000390| 3b 0d 09 09 23 65 6e 64 | 69 66 09 0d 0d 09 23 65 |;...#end|if....#e|
|000003a0| 6c 73 65 0d 09 09 63 6f | 6e 73 74 20 63 68 61 72 |lse...co|nst char|
|000003b0| 2a 20 6b 44 61 74 61 62 | 61 73 65 4e 61 6d 65 20 |* kDatab|aseName |
|000003c0| 3d 20 22 6f 6f 66 74 73 | 74 30 37 2e 64 62 22 3b |= "oofts|t07.db";|
|000003d0| 0d 09 09 63 6f 6e 73 74 | 20 63 68 61 72 2a 20 6b |...const| char* k|
|000003e0| 45 78 69 73 74 73 4e 61 | 6d 65 20 3d 20 6b 44 61 |ExistsNa|me = kDa|
|000003f0| 74 61 62 61 73 65 4e 61 | 6d 65 3b 0d 09 23 65 6e |tabaseNa|me;..#en|
|00000400| 64 69 66 0d 09 0d 09 64 | 6f 54 65 73 74 30 37 28 |dif....d|oTest07(|
|00000410| 6b 45 78 69 73 74 73 4e | 61 6d 65 2c 20 6b 44 61 |kExistsN|ame, kDa|
|00000420| 74 61 62 61 73 65 4e 61 | 6d 65 29 3b 0d 09 72 65 |tabaseNa|me);..re|
|00000430| 74 75 72 6e 20 45 58 49 | 54 5f 53 55 43 43 45 53 |turn EXI|T_SUCCES|
|00000440| 53 3b 0d 7d 0d 00 00 00 | 00 00 00 00 00 00 00 00 |S;.}....|........|
|00000450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000480| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00000490| 00 00 c5 62 00 00 08 1e | 05 00 00 00 c6 19 00 00 |...b....|........|
|000004a0| 08 4c 05 00 00 00 c6 d4 | 00 00 08 98 05 00 00 00 |.L......|........|
|000004b0| 0c 6f 6f 66 74 73 74 30 | 37 2e 63 70 70 30 02 00 |.ooftst0|7.cpp0..|
|000004c0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|000004d0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|000004e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004f0| 00 00 b0 1b 75 f5 00 00 | 00 00 00 00 01 9a 00 00 |....u...|........|
|00000500| cd 26 00 00 02 35 05 00 | 00 00 cd db 00 00 06 62 |.&...5..|.......b|
|00000510| 05 00 00 00 ce 4d 00 00 | 06 91 05 00 00 00 ce cb |.....M..|........|
|00000520| 00 00 09 e3 05 00 00 00 | cf 43 00 00 02 3c 05 00 |........|.C...<..|
|00000530| 00 00 cf 85 00 00 00 e3 | 05 00 00 00 cf df 00 00 |........|........|
|00000540| 01 8f 05 00 00 00 d0 65 | 00 00 02 0f 05 00 00 00 |.......e|........|
|00000550| d0 f9 00 00 02 a8 05 00 | 00 00 d1 98 00 00 02 db |........|........|
|00000560| 05 00 00 00 d2 23 00 00 | 03 39 05 00 00 00 d2 ae |.....#..|.9......|
|00000570| 00 00 03 75 05 00 00 00 | d3 2b 00 00 03 b0 05 00 |...u....|.+......|
|00000580| 00 00 00 04 00 01 00 01 | 00 00 00 48 00 09 4d 6f |........|...H..Mo|
|00000590| 6e 61 63 6f 00 30 ff c8 | 2d 0a 00 08 a3 8a 00 00 |naco.0..|-.......|
|000005a0| 02 56 d1 b0 02 49 04 28 | 02 56 02 56 00 00 00 06 |.V...I.(|.V.V....|
|000005b0| 00 04 00 62 00 dc 02 6c | 03 3b 00 62 00 dc 02 6c |...b...l|.;.b...l|
|000005c0| 03 3b af 53 62 d9 00 00 | 00 00 00 00 00 00 00 00 |.;.Sb...|........|
|000005d0| 00 00 01 00 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|000005e0| 00 00 00 46 02 49 08 98 | 2b 56 00 00 00 1c 00 46 |...F.I..|+V.....F|
|000005f0| 00 01 4d 57 42 42 00 00 | 00 12 4d 50 53 52 00 00 |..MWBB..|..MPSR..|
|00000600| 00 1e 03 f0 ff ff 00 00 | 00 00 00 00 00 00 03 ed |........|........|
|00000610| ff ff 00 00 00 08 02 49 | 04 90 00 00 00 00 00 00 |.......I|........|
|00000620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+